<ul>
<?php
foreach($cats as $cat) {
	if ($cat['Category']['total'] > 0) {
		$pl = ($cat['Category']['total'] == 1) ? 'product' : 'products';
		echo "<li>" . $cat['Category']['category_name'] . ' (' . $cat['Category']['total'] . ' ' . $pl . ' listed)';
		echo "<ul>";
		foreach($cat['Subcategory'] as $sub) {
			if ($sub['total'] > 0) {
				$pl = ($sub['total'] == 1) ? 'product' : 'products';
				echo "<li>" . $html->link($sub['subcategory_name'],'/subcategories/view/'.$sub['subcategory_id']) . ' (' . $sub['total'] . ' ' . $pl . ' listed)' . "</li>\n";
			}
		}
		echo "</ul>";
	}
}?>
</ul>
<?php //pr($cats);?>
